package com.srd.phone.utils.wheel.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.shengrongdai.srd.R;

public class DialogUtil extends Dialog implements View.OnClickListener {

	private Context mContext;
	private CallBack mCallBack = null;

	public DialogUtil(Context context, CallBack callBack) {
		super(context, R.style.dialog);
		this.mContext = context;
		this.mCallBack = callBack;

		show();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_del_message);

		findViewById(R.id.tv_commit).setOnClickListener(this);
		findViewById(R.id.tv_cancel).setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()){
			case R.id.tv_commit:
				mCallBack.onClick();
				cancel();
				break;

			case R.id.tv_cancel:
				cancel();
				break;
		}

	}

	public interface CallBack {
		void onClick();
	}
}